package com.zhaohui.service;

import com.zhaohui.dao.UserDao;
import com.zhaohui.entity.User;

import java.sql.SQLException;
import java.util.List;

public class UserService {
    private UserDao dao = new UserDao();

    public boolean login(String acc,String pass){
        try {
            List<User> all = dao.findAll();
            for (User user:all){
                if (user.getAcc().equals(acc)&&user.getPass().equals(pass)){
                    return true;
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }
}
